/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('hdr', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ChangeRecoveryPointRequest {
  eipAddressId?: string(name='EipAddressId', example='eip-2zelae2qye2ztjfj82f9z'),
  recoveryCpu?: int32(name='RecoveryCpu', example='4'),
  recoveryEssdPerformanceLevel?: string(name='RecoveryEssdPerformanceLevel', example='PL1'),
  recoveryInstanceName?: string(name='RecoveryInstanceName', example='HDR_Recovery-sr-000c9550g8gycc8oi4fb-cpr'),
  recoveryInstanceType?: string(name='RecoveryInstanceType', example='ecs.r6.3xlarge'),
  recoveryIpAddress?: string(name='RecoveryIpAddress', example='192.168.2.2'),
  recoveryMemory?: long(name='RecoveryMemory', example='4294967296'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-uf61v3bg6r790ir22jqv4'),
  recoveryPointId?: string(name='RecoveryPointId', example='rp-0001625ljmig7ahibe0y'),
  recoveryPointTime?: long(name='RecoveryPointTime', example='1637002799'),
  recoveryPostScriptContent?: string(name='RecoveryPostScriptContent', example='echo \\"127.0.0.1 kubernetes.docker.internal\\" >> /etc/hosts'),
  recoveryPostScriptType?: string(name='RecoveryPostScriptType', example='SHELL'),
  recoveryReserveIp?: boolean(name='RecoveryReserveIp', example='false'),
  recoveryUseDhcp?: boolean(name='RecoveryUseDhcp', example='true'),
  recoveryUseEssd?: boolean(name='RecoveryUseEssd', example='false'),
  recoveryUseSsd?: boolean(name='RecoveryUseSsd', example='false'),
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000bak4sdet6gv8q0c2j'),
}

model ChangeRecoveryPointResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='BBCC4082-98DF-5804-96C6-0E74C37C5867'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-0007wl5r0hvxrj68rrbg'),
}

model ChangeRecoveryPointResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ChangeRecoveryPointResponseBody(name='body'),
}

async function changeRecoveryPointWithOptions(request: ChangeRecoveryPointRequest, runtime: Util.RuntimeOptions): ChangeRecoveryPointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eipAddressId)) {
    query['EipAddressId'] = request.eipAddressId;
  }
  if (!Util.isUnset(request.recoveryCpu)) {
    query['RecoveryCpu'] = request.recoveryCpu;
  }
  if (!Util.isUnset(request.recoveryEssdPerformanceLevel)) {
    query['RecoveryEssdPerformanceLevel'] = request.recoveryEssdPerformanceLevel;
  }
  if (!Util.isUnset(request.recoveryInstanceName)) {
    query['RecoveryInstanceName'] = request.recoveryInstanceName;
  }
  if (!Util.isUnset(request.recoveryInstanceType)) {
    query['RecoveryInstanceType'] = request.recoveryInstanceType;
  }
  if (!Util.isUnset(request.recoveryIpAddress)) {
    query['RecoveryIpAddress'] = request.recoveryIpAddress;
  }
  if (!Util.isUnset(request.recoveryMemory)) {
    query['RecoveryMemory'] = request.recoveryMemory;
  }
  if (!Util.isUnset(request.recoveryNetwork)) {
    query['RecoveryNetwork'] = request.recoveryNetwork;
  }
  if (!Util.isUnset(request.recoveryPointId)) {
    query['RecoveryPointId'] = request.recoveryPointId;
  }
  if (!Util.isUnset(request.recoveryPointTime)) {
    query['RecoveryPointTime'] = request.recoveryPointTime;
  }
  if (!Util.isUnset(request.recoveryPostScriptContent)) {
    query['RecoveryPostScriptContent'] = request.recoveryPostScriptContent;
  }
  if (!Util.isUnset(request.recoveryPostScriptType)) {
    query['RecoveryPostScriptType'] = request.recoveryPostScriptType;
  }
  if (!Util.isUnset(request.recoveryReserveIp)) {
    query['RecoveryReserveIp'] = request.recoveryReserveIp;
  }
  if (!Util.isUnset(request.recoveryUseDhcp)) {
    query['RecoveryUseDhcp'] = request.recoveryUseDhcp;
  }
  if (!Util.isUnset(request.recoveryUseEssd)) {
    query['RecoveryUseEssd'] = request.recoveryUseEssd;
  }
  if (!Util.isUnset(request.recoveryUseSsd)) {
    query['RecoveryUseSsd'] = request.recoveryUseSsd;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeRecoveryPoint',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function changeRecoveryPoint(request: ChangeRecoveryPointRequest): ChangeRecoveryPointResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeRecoveryPointWithOptions(request, runtime);
}

model CommitFailoverRequest {
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000bzkmmlwghq3soqry2'),
}

model CommitFailoverResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='18603D03-FEA4-5FA8-878F-B03F11578F5F'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-0007wl5r0hvxrj68rrbg'),
}

model CommitFailoverResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CommitFailoverResponseBody(name='body'),
}

async function commitFailoverWithOptions(request: CommitFailoverRequest, runtime: Util.RuntimeOptions): CommitFailoverResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CommitFailover',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function commitFailover(request: CommitFailoverRequest): CommitFailoverResponse {
  var runtime = new Util.RuntimeOptions{};
  return commitFailoverWithOptions(request, runtime);
}

model CreateRecoveryPlanRequest {
  content?: string(name='Content', example='{
    "groups": [
        {
            "name": "Group-1",
            "id": "Group-1",
            "servers": [
                {
                    "name": "sr-xxxxxxxxxxxxxxxxxx",
                    "serverId": "sr-xxxxxxxxxxxxxxxxxx",
                    "testFailoverAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-tfo",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    },
                    "testCleanupAction": {},
                    "changeRecoveryPointAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-cpr",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    },
                    "forcedFailoverAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-ffo",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    }
                }
            ]
        }
    ]
}'),
  direction?: string(name='Direction', example='forward'),
  name?: string(name='Name', example='test1'),
  sitePairId?: string(name='SitePairId', example='s-xxxxxxxxxxxxxxxxxx'),
}

model CreateRecoveryPlanResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='FEC3D491-15BB-5C8F-902E-773794FF1B29'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-00055g8sxr0ys0g99n83'),
}

model CreateRecoveryPlanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateRecoveryPlanResponseBody(name='body'),
}

async function createRecoveryPlanWithOptions(request: CreateRecoveryPlanRequest, runtime: Util.RuntimeOptions): CreateRecoveryPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRecoveryPlan',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRecoveryPlan(request: CreateRecoveryPlanRequest): CreateRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRecoveryPlanWithOptions(request, runtime);
}

model CreateSitePairRequest {
  primarySiteName?: string(name='PrimarySiteName'),
  primarySiteRegionId?: string(name='PrimarySiteRegionId', example='cn-shanghai'),
  primarySiteType?: string(name='PrimarySiteType', example='cloud'),
  primarySiteVpcId?: string(name='PrimarySiteVpcId', example='vpc-uf6j3rao8wkr7hb4uopv2'),
  primarySiteZoneId?: string(name='PrimarySiteZoneId', example='cn-hangzhou-g'),
  secondarySiteName?: string(name='SecondarySiteName'),
  secondarySiteRegionId?: string(name='SecondarySiteRegionId', example='cn-hangzhou'),
  secondarySiteType?: string(name='SecondarySiteType', example='cloud'),
  secondarySiteVpcId?: string(name='SecondarySiteVpcId', example='vpc-bp1wu55gbyqd7gh3yu3ey'),
  secondarySiteZoneId?: string(name='SecondarySiteZoneId', example='cn-hangzhou-i'),
  securityToken?: string(name='SecurityToken'),
  sitePairType?: string(name='SitePairType', example='cloud2cloud'),
}

model CreateSitePairResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  primarySiteId?: string(name='PrimarySiteId', example='si-0001jntih0phb0i2w1ya'),
  requestId?: string(name='RequestId', example='D14F1EB0-30B7-5A38-92E7-C2D11077D5CA'),
  secondarySiteId?: string(name='SecondarySiteId', example='si-000imvpcegvbh6i5kd2u'),
  sitePairId?: string(name='SitePairId', example='s-000bvn4shsuhq4cph5i8'),
  success?: boolean(name='Success', example='True'),
}

model CreateSitePairResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSitePairResponseBody(name='body'),
}

async function createSitePairWithOptions(request: CreateSitePairRequest, runtime: Util.RuntimeOptions): CreateSitePairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.primarySiteName)) {
    query['PrimarySiteName'] = request.primarySiteName;
  }
  if (!Util.isUnset(request.primarySiteRegionId)) {
    query['PrimarySiteRegionId'] = request.primarySiteRegionId;
  }
  if (!Util.isUnset(request.primarySiteType)) {
    query['PrimarySiteType'] = request.primarySiteType;
  }
  if (!Util.isUnset(request.primarySiteVpcId)) {
    query['PrimarySiteVpcId'] = request.primarySiteVpcId;
  }
  if (!Util.isUnset(request.primarySiteZoneId)) {
    query['PrimarySiteZoneId'] = request.primarySiteZoneId;
  }
  if (!Util.isUnset(request.secondarySiteName)) {
    query['SecondarySiteName'] = request.secondarySiteName;
  }
  if (!Util.isUnset(request.secondarySiteRegionId)) {
    query['SecondarySiteRegionId'] = request.secondarySiteRegionId;
  }
  if (!Util.isUnset(request.secondarySiteType)) {
    query['SecondarySiteType'] = request.secondarySiteType;
  }
  if (!Util.isUnset(request.secondarySiteVpcId)) {
    query['SecondarySiteVpcId'] = request.secondarySiteVpcId;
  }
  if (!Util.isUnset(request.secondarySiteZoneId)) {
    query['SecondarySiteZoneId'] = request.secondarySiteZoneId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sitePairType)) {
    query['SitePairType'] = request.sitePairType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSitePair',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSitePair(request: CreateSitePairRequest): CreateSitePairResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSitePairWithOptions(request, runtime);
}

model DeleteRecoveryPlanRequest {
  recoveryPlanId?: string(name='RecoveryPlanId', example='rp-xxxxxxxxxxxxxxxx'),
}

model DeleteRecoveryPlanResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='36C9E5CF-D575-5074-9A3E-79251448D708'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-0006ezqwy1swxqgcrfvx'),
}

model DeleteRecoveryPlanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteRecoveryPlanResponseBody(name='body'),
}

async function deleteRecoveryPlanWithOptions(request: DeleteRecoveryPlanRequest, runtime: Util.RuntimeOptions): DeleteRecoveryPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.recoveryPlanId)) {
    query['RecoveryPlanId'] = request.recoveryPlanId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRecoveryPlan',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRecoveryPlan(request: DeleteRecoveryPlanRequest): DeleteRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRecoveryPlanWithOptions(request, runtime);
}

model DeleteSitePairRequest {
  securityToken?: string(name='SecurityToken'),
  sitePairId?: string(name='SitePairId', example='s-0003obqyc8f8a6u3bfw4'),
}

model DeleteSitePairResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='26365F46-16D9-5A56-B1EF-62D12C04E071'),
  success?: boolean(name='Success', example='True'),
}

model DeleteSitePairResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSitePairResponseBody(name='body'),
}

async function deleteSitePairWithOptions(request: DeleteSitePairRequest, runtime: Util.RuntimeOptions): DeleteSitePairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSitePair',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSitePair(request: DeleteSitePairRequest): DeleteSitePairResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSitePairWithOptions(request, runtime);
}

model DescribeAvailableInstanceTypesRequest {
  chargeType?: string(name='ChargeType', example='PostPaid'),
  diskType?: string(name='DiskType', example='cloud_efficiency'),
  filter?: string(name='Filter', description='-', example='-'),
  ioOptimized?: boolean(name='IoOptimized', example='true'),
  network?: string(name='Network', example='vpc'),
  order?: string(name='Order', example='asc'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  region?: string(name='Region', example='cn-shanghai'),
  securityToken?: string(name='SecurityToken'),
  sortBy?: string(name='SortBy', example='vcpu'),
  userClient?: boolean(name='UserClient', example='true'),
  zoneId?: string(name='ZoneId', example='cn-beijing-g'),
}

model DescribeAvailableInstanceTypesResponseBody = {
  code?: string(name='Code', example='200'),
  instanceTypes?: {
    instanceType?: [ string ](name='instanceType')
  }(name='InstanceTypes'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='1A7577E8-755A-5BF5-A6BA-B87286D0743F'),
  success?: boolean(name='Success', example='True'),
  totalCount?: int32(name='TotalCount', example='11'),
}

model DescribeAvailableInstanceTypesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAvailableInstanceTypesResponseBody(name='body'),
}

async function describeAvailableInstanceTypesWithOptions(request: DescribeAvailableInstanceTypesRequest, runtime: Util.RuntimeOptions): DescribeAvailableInstanceTypesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.diskType)) {
    query['DiskType'] = request.diskType;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.ioOptimized)) {
    query['IoOptimized'] = request.ioOptimized;
  }
  if (!Util.isUnset(request.network)) {
    query['Network'] = request.network;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.userClient)) {
    query['UserClient'] = request.userClient;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableInstanceTypes',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAvailableInstanceTypes(request: DescribeAvailableInstanceTypesRequest): DescribeAvailableInstanceTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableInstanceTypesWithOptions(request, runtime);
}

model DescribeInfrastructuresRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  securityToken?: string(name='SecurityToken'),
  siteId?: string(name='SiteId', example='si-0005btelnqjwguycypba'),
}

model DescribeInfrastructuresResponseBody = {
  code?: string(name='Code', example='200'),
  infrastructures?: {
    infrastructure?: [ 
    {
      errno?: string(name='Errno', example='cdr.console.plugin.failed_to_connect'),
      infrastructureId?: string(name='InfrastructureId', example='is-0005qxusucbig0c42dlo'),
      ipAddress?: string(name='IpAddress', example='172.18.122.66'),
      name?: string(name='Name', example='si-0006w0mxd3w8jiifu77l-infrastructure1'),
      status?: string(name='Status', example='connected'),
      type?: string(name='Type', example='aliyun'),
    }
  ](name='infrastructure')
  }(name='Infrastructures'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='2'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='32AC7E7F-5484-548D-8D3F-905238B75080'),
  success?: boolean(name='Success', example='True'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeInfrastructuresResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeInfrastructuresResponseBody(name='body'),
}

async function describeInfrastructuresWithOptions(request: DescribeInfrastructuresRequest, runtime: Util.RuntimeOptions): DescribeInfrastructuresResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.siteId)) {
    query['SiteId'] = request.siteId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInfrastructures',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeInfrastructures(request: DescribeInfrastructuresRequest): DescribeInfrastructuresResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInfrastructuresWithOptions(request, runtime);
}

model DescribeRecoveryPlanRequest {
  recoveryPlanId?: string(name='RecoveryPlanId', example='rp-xxxxxxxxxxxxxxxxxx'),
}

model DescribeRecoveryPlanResponseBody = {
  code?: string(name='Code', example='200'),
  content?: string(name='Content', example='{
    "groups": [
        {
            "name": "Group-1",
            "id": "Group-1",
            "servers": [
                {
                    "name": "sr-xxxxxxxxxxxxxxxxxx",
                    "serverId": "sr-xxxxxxxxxxxxxxxxxx",
                    "testFailoverAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-tfo",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    },
                    "testCleanupAction": {},
                    "changeRecoveryPointAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-cpr",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    },
                    "forcedFailoverAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-ffo",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    }
                }
            ]
        }
    ]
}'),
  direction?: string(name='Direction', example='forward'),
  message?: string(name='Message', example='successful'),
  name?: string(name='Name', example='test'),
  recoveryPlanId?: string(name='RecoveryPlanId', example='rp-xxxxxxxxxxxxxxxxxx'),
  requestId?: string(name='RequestId', example='6F3884EC-AECB-52EF-AFE3-BC13A9688DEB'),
  status?: string(name='Status', example='init'),
  success?: boolean(name='Success', example='True'),
}

model DescribeRecoveryPlanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRecoveryPlanResponseBody(name='body'),
}

async function describeRecoveryPlanWithOptions(request: DescribeRecoveryPlanRequest, runtime: Util.RuntimeOptions): DescribeRecoveryPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.recoveryPlanId)) {
    query['RecoveryPlanId'] = request.recoveryPlanId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRecoveryPlan',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRecoveryPlan(request: DescribeRecoveryPlanRequest): DescribeRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecoveryPlanWithOptions(request, runtime);
}

model DescribeRecoveryPlansRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sitePairId?: string(name='SitePairId', example='s-0005qxusucbii5ab6wuj'),
}

model DescribeRecoveryPlansResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  recoveryPlans?: {
    recoveryPlan?: [ 
    {
      direction?: string(name='Direction', example='forward'),
      name?: string(name='Name', example='test-1'),
      recoveryPlanId?: string(name='RecoveryPlanId', example='rp-xxxxxxxxxxxxxxxxxx'),
      status?: string(name='Status', example='init'),
    }
  ](name='recoveryPlan')
  }(name='RecoveryPlans'),
  requestId?: string(name='RequestId', example='F2812CD7-03E7-5774-9EE5-827D8398A670'),
  success?: boolean(name='Success', example='True'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeRecoveryPlansResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRecoveryPlansResponseBody(name='body'),
}

async function describeRecoveryPlansWithOptions(request: DescribeRecoveryPlansRequest, runtime: Util.RuntimeOptions): DescribeRecoveryPlansResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRecoveryPlans',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRecoveryPlans(request: DescribeRecoveryPlansRequest): DescribeRecoveryPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecoveryPlansWithOptions(request, runtime);
}

model DescribeRecoveryPointsRequest {
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-0008fj9dbe1xzlg6805i'),
  startTime?: long(name='StartTime', example='1633503912'),
}

model DescribeRecoveryPointsResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  recoveryPoints?: {
    recoveryPoint?: [ 
    {
      applicationConsistent?: boolean(name='ApplicationConsistent', example='false'),
      disableReason?: string(name='DisableReason', example='inconsistent'),
      disabled?: boolean(name='Disabled', example='false'),
      recoveryPointId?: string(name='RecoveryPointId', example='rp-0000syrdl2f8a7te4063'),
      recoveryPointTime?: long(name='RecoveryPointTime', example='1637118000'),
      used?: boolean(name='Used', example='false'),
    }
  ](name='recoveryPoint')
  }(name='RecoveryPoints'),
  requestId?: string(name='RequestId', example='8260C928-1A54-545A-A3F2-51E6327D28E6'),
  success?: boolean(name='Success', example='True'),
  totalCount?: int32(name='TotalCount', example='15'),
}

model DescribeRecoveryPointsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRecoveryPointsResponseBody(name='body'),
}

async function describeRecoveryPointsWithOptions(request: DescribeRecoveryPointsRequest, runtime: Util.RuntimeOptions): DescribeRecoveryPointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRecoveryPoints',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRecoveryPoints(request: DescribeRecoveryPointsRequest): DescribeRecoveryPointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecoveryPointsWithOptions(request, runtime);
}

model DescribeServerRequest {
  serverId?: string(name='ServerId', example='sr-0005qxusucbiga738e9s'),
}

model DescribeServerResponseBody = {
  agentPort?: int32(name='AgentPort', example='9080'),
  agentVersion?: string(name='AgentVersion', example='3.7.3'),
  alias?: string(name='Alias', example='bsdewmpci_rz'),
  code?: string(name='Code', example='200'),
  connectionStatus?: string(name='ConnectionStatus', example='connected'),
  consistent?: boolean(name='Consistent', example='false'),
  cpu?: int32(name='Cpu', example='4'),
  crashConsistentPointPolicy?: string(name='CrashConsistentPointPolicy', example='{\\"scheduleType\\":\\"CRON\\",\\"expression\\":\\"0 0 */1 * * 0,1,2,3,4,5,6\\",\\"initialDelay\\":0}'),
  disks?: string(name='Disks', example='[{\\"id\\":\\"0\\",\\"boot\\":true,\\"size\\":500363689984}]'),
  errno?: string(name='Errno', example='cdr.console.plugin.failed_to_connect'),
  fullSyncCurrentSize?: long(name='FullSyncCurrentSize', example='3285276688384'),
  fullSyncProgress?: int32(name='FullSyncProgress', example='17'),
  fullSyncStartTime?: long(name='FullSyncStartTime', example='0'),
  fullSyncTotalSize?: long(name='FullSyncTotalSize', example='365072220160'),
  hostname?: string(name='Hostname', example='iZ2ze0jazgwtuxettbk1ywZ'),
  incrementalSyncStartTime?: long(name='IncrementalSyncStartTime', example='0'),
  ipAddress?: string(name='IpAddress', example='30.42.105.6'),
  latestRecoveryPointTime?: string(name='LatestRecoveryPointTime'),
  memory?: long(name='Memory', example='8589934591'),
  message?: string(name='Message', example='successful'),
  operations?: string(name='Operations', example='"{\\"Resynchronize\\":true,\\"TestFailover\\":true,\\"TestCleanup\\":true,\\"ChangeRecoveryPoint\\":true,\\"UnregisterServer\\":true,\\"ReversedEnableReplication\\":true,\\"ReversedDisableReplication\\":true,\\"DisableReplication\\":true,\\"CommitFailover\\":true,\\"RestartServer\\":true,\\"UpgradeServer\\":true,\\"ForcedFailover\\":true,\\"RepairReplication\\":true,\\"EnableReplication\\":true,\\"TriggerReversedRegister\\":true,\\"SetupAgent\\":true,\\"TriggerRegister\\":true,\\"CollectSupportBundle\\":true,\\"Failback\\":true}"'),
  originalInstanceId?: string(name='OriginalInstanceId', example='i-bp19axn91irnsi9204xg'),
  osDetail?: string(name='OsDetail', example='CentOS;7.9.2009'),
  osType?: string(name='OsType', example='linux'),
  primarySiteId?: string(name='PrimarySiteId', example='si-0001jntih0phb0i2w1ya'),
  recoveredInstanceId?: string(name='RecoveredInstanceId', example='i-bp19axn91irnsi9204xg'),
  recoveredIpAddress?: string(name='RecoveredIpAddress', example='192.168.2.2'),
  recoveryCpu?: int32(name='RecoveryCpu', example='4'),
  recoveryEssdPerformanceLevel?: string(name='RecoveryEssdPerformanceLevel', example='PL1'),
  recoveryInstanceName?: string(name='RecoveryInstanceName', example='HDR_Recovery-sr-000bzkmmlwghq3soqry2'),
  recoveryInstanceType?: string(name='RecoveryInstanceType', example='ecs.c5.2xlarge'),
  recoveryIpAddress?: string(name='RecoveryIpAddress', example='192.168.2.2'),
  recoveryMemory?: long(name='RecoveryMemory', example='4294967296'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-uf61v3bg6r790ir22jqv4'),
  recoveryPostScriptContent?: string(name='RecoveryPostScriptContent', example='echo \\"127.0.0.1 kubernetes.docker.internal\\" >> /etc/hosts'),
  recoveryPostScriptType?: string(name='RecoveryPostScriptType', example='SHELL'),
  recoveryReserveIp?: boolean(name='RecoveryReserveIp', example='false'),
  recoveryUseDhcp?: boolean(name='RecoveryUseDhcp', example='false'),
  recoveryUseEssd?: boolean(name='RecoveryUseEssd', example='false'),
  recoveryUseSsd?: boolean(name='RecoveryUseSsd', example='false'),
  replicationInfrastructureId?: string(name='ReplicationInfrastructureId', example='is-000bzkmmlwgibbduuoff'),
  replicationInfrastructureType?: string(name='ReplicationInfrastructureType', example='aliyun'),
  replicationNetwork?: string(name='ReplicationNetwork', example='vsw-bp1g0s2u3b2kbn46kiy53'),
  replicationUseDhcp?: boolean(name='ReplicationUseDhcp', description='-', example='-'),
  replicationUseEssd?: boolean(name='ReplicationUseEssd', example='false'),
  replicationUseOriginalInstance?: boolean(name='ReplicationUseOriginalInstance', example='false'),
  replicationUseSsd?: boolean(name='ReplicationUseSsd', example='false'),
  requestId?: string(name='RequestId', example='BBCC4082-98DF-5804-96C6-0E74C37C5867'),
  rpo?: int32(name='Rpo', example='45'),
  secondarySiteId?: string(name='SecondarySiteId', example='si-000imvpcegvbh6i5kd2u'),
  serverId?: string(name='ServerId', example='sr-0005qxusucbiip0g6t93'),
  sourceGatewayVersion?: string(name='SourceGatewayVersion', example='3.7.3'),
  status?: string(name='Status', example='replicating'),
  success?: boolean(name='Success', example='True'),
  targetGatewayVersion?: string(name='TargetGatewayVersion', example='i-bp13zgzv13am2n2z92lb'),
  taskId?: string(name='TaskId', example='t-0004ka624vrza82g46ne'),
  testFailoverStatus?: string(name='TestFailoverStatus', example='testFailovered'),
  testRecoveredInstanceId?: string(name='TestRecoveredInstanceId', example='i-bp13zgzv13am2n2z92lb'),
  testRecoveredInstanceName?: string(name='TestRecoveredInstanceName', example='HDR_Recovery-sr-000c2rz7q8tak59pt6sw'),
  testRecoveredIpAddress?: string(name='TestRecoveredIpAddress', example='192.168.2.2'),
}

model DescribeServerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeServerResponseBody(name='body'),
}

async function describeServerWithOptions(request: DescribeServerRequest, runtime: Util.RuntimeOptions): DescribeServerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeServer',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeServer(request: DescribeServerRequest): DescribeServerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeServerWithOptions(request, runtime);
}

model DescribeServersRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  securityToken?: string(name='SecurityToken'),
  serverIds?: string(name='ServerIds', example='"[\\"sr-0005qxusucbi38lqfc2q\\",\\"sr-0005qxusucbi38lqfc2r\\"]"'),
  sitePairId?: string(name='SitePairId', example='s-0007rvzart0u501t4e5r'),
}

model DescribeServersResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='2'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='D2B255D3-9736-5169-B488-C735A8BBCD79'),
  servers?: {
    server?: [ 
    {
      agentPort?: int32(name='AgentPort', example='9080'),
      agentVersion?: string(name='AgentVersion', example='3.7.3'),
      alias?: string(name='Alias', example='test-ecs'),
      connectionStatus?: string(name='ConnectionStatus', example='connected'),
      consistent?: boolean(name='Consistent', example='true'),
      cpu?: int32(name='Cpu', example='4'),
      crashConsistentPointPolicy?: string(name='CrashConsistentPointPolicy', example='"{\\"scheduleType\\":\\"CRON\\",\\"expression\\":\\"0 0 */1 * * 0,1,2,3,4,5,6\\",\\"initialDelay\\":0}"'),
      disks?: string(name='Disks', example='[{\\"id\\":\\"0\\",\\"boot\\":true,\\"size\\":500363689984}]'),
      errno?: string(name='Errno', example='cdr.console.plugin.alicloud.agent_deploy_already_installed'),
      fullSyncCurrentSize?: long(name='FullSyncCurrentSize', example='1603469836288'),
      fullSyncProgress?: int32(name='FullSyncProgress', example='0'),
      fullSyncStartTime?: long(name='FullSyncStartTime', example='0'),
      fullSyncTotalSize?: long(name='FullSyncTotalSize', example='150202220544'),
      hostname?: string(name='Hostname', example='test'),
      incrementalSyncStartTime?: long(name='IncrementalSyncStartTime', example='1646049677'),
      instanceId?: string(name='InstanceId', example='i-bp19axn91irnsi9204xg'),
      ipAddress?: string(name='IpAddress', example='30.42.105.6'),
      latestRecoveryPointTime?: long(name='LatestRecoveryPointTime'),
      memory?: long(name='Memory', example='4294967295'),
      operations?: string(name='Operations', example='"{\\"Resynchronize\\":true,\\"TestFailover\\":true,\\"TestCleanup\\":true,\\"ChangeRecoveryPoint\\":true,\\"UnregisterServer\\":true,\\"ReversedEnableReplication\\":true,\\"ReversedDisableReplication\\":true,\\"DisableReplication\\":true,\\"CommitFailover\\":true,\\"RestartServer\\":true,\\"UpgradeServer\\":true,\\"ForcedFailover\\":true,\\"RepairReplication\\":true,\\"EnableReplication\\":true,\\"TriggerReversedRegister\\":true,\\"SetupAgent\\":true,\\"TriggerRegister\\":true,\\"CollectSupportBundle\\":true,\\"Failback\\":true}"'),
      originalInstanceId?: string(name='OriginalInstanceId', example='i-bp19axn91irnsi9204xg'),
      osDetail?: string(name='OsDetail', example='CentOS;7.9.2009'),
      osType?: string(name='OsType', example='linux'),
      primarySiteId?: string(name='PrimarySiteId', example='si-000cm9ax8sgplgye2vc4'),
      recoveredInstanceId?: string(name='RecoveredInstanceId', example='i-bp19axn91irnsi9204xg'),
      recoveredInstanceName?: string(name='RecoveredInstanceName', description='-', example='-'),
      recoveredIpAddress?: string(name='RecoveredIpAddress', example='192.168.2.2'),
      recoveryCpu?: int32(name='RecoveryCpu', example='4'),
      recoveryEssdPerformanceLevel?: string(name='RecoveryEssdPerformanceLevel', example='PL3'),
      recoveryInstanceName?: string(name='RecoveryInstanceName', example='HDR_Recovery-sr-000c2rz7q8tak59pt6sw'),
      recoveryInstanceType?: string(name='RecoveryInstanceType', example='ecs.r6.3xlarge'),
      recoveryIpAddress?: string(name='RecoveryIpAddress', example='192.168.2.2'),
      recoveryMemory?: long(name='RecoveryMemory', example='8589934592'),
      recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-uf63qu8ocjcly44tai570'),
      recoveryPostScriptContent?: string(name='RecoveryPostScriptContent', example='"echo \\"127.0.0.1 kubernetes.docker.internal\\" >> /etc/hosts"'),
      recoveryPostScriptType?: string(name='RecoveryPostScriptType', example='SHELL'),
      recoveryReserveIp?: boolean(name='RecoveryReserveIp', example='true'),
      recoveryUseDhcp?: boolean(name='RecoveryUseDhcp', example='true'),
      recoveryUseEssd?: boolean(name='RecoveryUseEssd', example='false'),
      recoveryUseSsd?: boolean(name='RecoveryUseSsd', example='true'),
      replicationInfrastructureId?: string(name='ReplicationInfrastructureId', example='is-0004ka624vrxd9xsvs4f'),
      replicationInfrastructureType?: string(name='ReplicationInfrastructureType', example='aliyun'),
      replicationNetwork?: string(name='ReplicationNetwork', example='vsw-2zey7xe0m8dbqrks2jb9h'),
      replicationUseDhcp?: boolean(name='ReplicationUseDhcp', example='false'),
      replicationUseEssd?: boolean(name='ReplicationUseEssd', example='false'),
      replicationUseOriginalInstance?: boolean(name='ReplicationUseOriginalInstance', example='false'),
      replicationUseSsd?: boolean(name='ReplicationUseSsd', example='true'),
      rpo?: int32(name='Rpo', example='30'),
      secondarySiteId?: string(name='SecondarySiteId', example='si-0007o5em8n6mhm8hee1l'),
      serverId?: string(name='ServerId', example='sr-000cm9ax8sh2381wa7kv'),
      sourceGatewayVersion?: string(name='SourceGatewayVersion', example='3.7.3'),
      status?: string(name='Status', example='replicating'),
      targetGatewayVersion?: string(name='TargetGatewayVersion', example='3.7.3'),
      taskId?: string(name='TaskId', example='t-0007rvzart0v31c0x93q'),
      testFailoverStatus?: string(name='TestFailoverStatus', example='testFailovered'),
      testRecoveredInstanceId?: string(name='TestRecoveredInstanceId', example='i-bp13zgzv13am2n2z92lb'),
      testRecoveredInstanceName?: string(name='TestRecoveredInstanceName', example='HDR_Recovery-sr-000c2rz7q8tak59pt6sw'),
      testRecoveredIpAddress?: string(name='TestRecoveredIpAddress', example='192.168.2.2'),
    }
  ](name='server')
  }(name='Servers'),
  success?: boolean(name='Success', example='True'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model DescribeServersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeServersResponseBody(name='body'),
}

async function describeServersWithOptions(request: DescribeServersRequest, runtime: Util.RuntimeOptions): DescribeServersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverIds)) {
    query['ServerIds'] = request.serverIds;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeServers',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeServers(request: DescribeServersRequest): DescribeServersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeServersWithOptions(request, runtime);
}

model DescribeSiteRequest {
  siteId?: string(name='SiteId', example='si-000bzkmmlwh01trrecuw'),
}

model DescribeSiteResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  name?: string(name='Name', example='SH'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  requestId?: string(name='RequestId', example='B30A844D-E4CF-5382-A0D4-3DE76A8AD2AE'),
  siteId?: string(name='SiteId', example='si-000bzkmmlwh01trrecuw'),
  success?: boolean(name='Success', example='True'),
  type?: string(name='Type', example='cloud'),
  userSecurityGroupId?: string(name='UserSecurityGroupId', example='sg-bp1466glrmpqfsq4zpjs'),
  vpcId?: string(name='VpcId', example='vpc-bp1c3byhnaoj3u96sgk12'),
  zoneId?: string(name='ZoneId', example='cn-shanghai-l'),
}

model DescribeSiteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSiteResponseBody(name='body'),
}

async function describeSiteWithOptions(request: DescribeSiteRequest, runtime: Util.RuntimeOptions): DescribeSiteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.siteId)) {
    query['SiteId'] = request.siteId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSite',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSite(request: DescribeSiteRequest): DescribeSiteResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteWithOptions(request, runtime);
}

model DescribeSitePairRequest {
  securityToken?: string(name='SecurityToken'),
  sitePairId?: string(name='SitePairId', example='s-0007rvzart0c4cn130df'),
}

model DescribeSitePairResponseBody = {
  code?: string(name='Code', example='200'),
  createdTime?: long(name='CreatedTime', example='1637293095'),
  message?: string(name='Message', example='successful'),
  primarySiteId?: string(name='PrimarySiteId', example='si-0001jntih0phb0i2w1ya'),
  primarySiteName?: string(name='PrimarySiteName'),
  requestId?: string(name='RequestId', example='700F1972-16A2-5639-A937-D2A6D61557B8'),
  secondarySiteId?: string(name='SecondarySiteId', example='si-0007rvzart0a2wpup82m'),
  secondarySiteName?: string(name='SecondarySiteName'),
  sitePairId?: string(name='SitePairId', example='s-000j6lhiuvdqakqa6k7l'),
  sitePairType?: string(name='SitePairType', example='cloud2cloud'),
  success?: boolean(name='Success', example='True'),
  version?: string(name='Version', example='3.7.3'),
}

model DescribeSitePairResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSitePairResponseBody(name='body'),
}

async function describeSitePairWithOptions(request: DescribeSitePairRequest, runtime: Util.RuntimeOptions): DescribeSitePairResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSitePair',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSitePair(request: DescribeSitePairRequest): DescribeSitePairResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSitePairWithOptions(request, runtime);
}

model DescribeSitePairStatisticsRequest {
  securityToken?: string(name='SecurityToken'),
  sitePairId?: string(name='SitePairId', example='s-0005qxusucbp8acutbrv'),
}

model DescribeSitePairStatisticsResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  primarySiteGatewayInfo?: {
    gatewayId?: string(name='GatewayId', example='gw-000bzkmmlwgzptnzsdnh'),
    heartbeatedTime?: long(name='HeartbeatedTime', example='1642562996'),
    status?: string(name='Status', example='connected'),
    version?: string(name='Version', example='3.7.3'),
  }(name='PrimarySiteGatewayInfo'),
  primarySiteServers?: {
    server?: [ 
    {
      agentVersion?: string(name='AgentVersion', example='3.7.3'),
      connectionStatus?: string(name='ConnectionStatus', example='connected'),
      ipAddress?: string(name='IpAddress', example='30.42.105.6'),
      serverId?: string(name='ServerId', example='sr-000c2rz7q8tkc0g4xgao'),
    }
  ](name='server')
  }(name='PrimarySiteServers'),
  requestId?: string(name='RequestId', example='C0D9AAEE-8A21-5693-BCBD-8548914E4F3B'),
  secondarySiteGatewayInfo?: {
    gatewayId?: string(name='GatewayId', example='gw-0005qxusucbigzug9wpe'),
    heartbeatedTime?: long(name='HeartbeatedTime', example='1642562996'),
    status?: string(name='Status', example='connected'),
    version?: string(name='Version', example='3.7.3'),
  }(name='SecondarySiteGatewayInfo'),
  secondarySiteServers?: {
    server?: [ 
    {
      agentVersion?: string(name='AgentVersion', example='3.7.3'),
      connectionStatus?: string(name='ConnectionStatus', example='connected'),
      ipAddress?: string(name='IpAddress', example='192.168.1.4'),
      serverId?: string(name='ServerId', example='sr-000ikcyl8ucxtxl5f7pi'),
    }
  ](name='server')
  }(name='SecondarySiteServers'),
  success?: boolean(name='Success', example='True'),
}

model DescribeSitePairStatisticsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSitePairStatisticsResponseBody(name='body'),
}

async function describeSitePairStatisticsWithOptions(request: DescribeSitePairStatisticsRequest, runtime: Util.RuntimeOptions): DescribeSitePairStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSitePairStatistics',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSitePairStatistics(request: DescribeSitePairStatisticsRequest): DescribeSitePairStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSitePairStatisticsWithOptions(request, runtime);
}

model DescribeSitePairsRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sitePairType?: string(name='SitePairType', example='cloud2cloud'),
}

model DescribeSitePairsResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='5'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='24CFBF97-EAD7-5D53-8D50-7F9E9D20C3A3'),
  sitePairs?: {
    sitePair?: [ 
    {
      cloudSiteName?: string(name='CloudSiteName', example='cloud-site'),
      createdTime?: long(name='CreatedTime', example='1636092147'),
      localSiteName?: string(name='LocalSiteName', example='local-site'),
      primarySiteId?: string(name='PrimarySiteId', example='si-000as7kbj0cmlp3tt60m'),
      primarySiteName?: string(name='PrimarySiteName', example='HZ'),
      replicationStatistics?: {
        critical?: long(name='Critical', example='0'),
        healthy?: long(name='Healthy', example='4'),
        notApplicable?: long(name='NotApplicable', example='0'),
        warning?: long(name='Warning', example='0'),
      }(name='ReplicationStatistics'),
      secondarySiteId?: string(name='SecondarySiteId', example='si-0007nrkb2riv9yalg8s8'),
      secondarySiteName?: string(name='SecondarySiteName', example='SH'),
      serverCount?: int32(name='ServerCount', example='14'),
      sitePairId?: string(name='SitePairId', example='s-0003obqyc8f8lx2pf6m9'),
      sitePairType?: string(name='SitePairType', example='cloud2cloud'),
      version?: string(name='Version', example='3.7.3'),
    }
  ](name='sitePair')
  }(name='SitePairs'),
  success?: boolean(name='Success', example='True'),
  totalCount?: int32(name='TotalCount', example='28'),
}

model DescribeSitePairsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSitePairsResponseBody(name='body'),
}

async function describeSitePairsWithOptions(request: DescribeSitePairsRequest, runtime: Util.RuntimeOptions): DescribeSitePairsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sitePairType)) {
    query['SitePairType'] = request.sitePairType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSitePairs',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSitePairs(request: DescribeSitePairsRequest): DescribeSitePairsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSitePairsWithOptions(request, runtime);
}

model DescribeSummaryRequest {
  securityToken?: string(name='SecurityToken'),
}

model DescribeSummaryResponseBody = {
  code?: string(name='Code', example='200'),
  dbServerCount?: long(name='DbServerCount', description='-', example='-'),
  message?: string(name='Message', example='successful'),
  replicationDetails?: {
    criticalServers?: {
      criticalServer?: [ 
      {
        connectionStatus?: string(name='ConnectionStatus', example='connected'),
        instanceId?: string(name='InstanceId', example='i-bp1a4374akk4527gbt9x'),
        rpo?: long(name='Rpo', description='RPO', example='30'),
        serverId?: string(name='ServerId', example='sr-0005qxusucb0fqqdf4ba'),
        sitePairId?: string(name='SitePairId', example='s-0005qxusucbii3ba2uve'),
        status?: string(name='Status', example='replicating'),
      }
    ](name='criticalServer')
    }(name='CriticalServers'),
    notApplicableServers?: {
      notApplicableServer?: [ 
      {
        connectionStatus?: string(name='ConnectionStatus', example='connected'),
        instanceId?: string(name='InstanceId', example='i-bp1a4374akk4527gbt9x'),
        rpo?: long(name='Rpo', description='RPO', example='40'),
        serverId?: string(name='ServerId', example='sr-000iji78mxxc93yldd2e'),
        sitePairId?: string(name='SitePairId', example='s-000bzkmmlwh5riquud19'),
        status?: string(name='Status', example='replicating'),
      }
    ](name='notApplicableServer')
    }(name='NotApplicableServers'),
    warningServers?: {
      warningServer?: [ 
      {
        connectionStatus?: string(name='ConnectionStatus', example='connected'),
        instanceId?: string(name='InstanceId', example='i-bp1a4374akk4527gbt9x'),
        rpo?: long(name='Rpo', description='RPO', example='30'),
        serverId?: string(name='ServerId', example='sr-000fzufp79icz33l4pak'),
        sitePairId?: string(name='SitePairId', example='s-000bzkmmlwh5riquud19'),
        status?: string(name='Status', example='replicating'),
      }
    ](name='warningServer')
    }(name='WarningServers'),
  }(name='ReplicationDetails'),
  requestId?: string(name='RequestId', example='DE78056B-E82A-52FD-BF5E-F737D8B63845'),
  serverCount?: long(name='ServerCount', example='2'),
  siteCount?: long(name='SiteCount', example='4'),
  success?: boolean(name='Success', example='True'),
  totalSize?: long(name='TotalSize', example='10'),
}

model DescribeSummaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSummaryResponseBody(name='body'),
}

async function describeSummaryWithOptions(request: DescribeSummaryRequest, runtime: Util.RuntimeOptions): DescribeSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSummary',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSummary(request: DescribeSummaryRequest): DescribeSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSummaryWithOptions(request, runtime);
}

model DescribeTaskRequest {
  taskId?: string(name='TaskId', example='t-0005qxusucbnl5efovq9'),
}

model DescribeTaskResponseBody = {
  code?: string(name='Code', example='200'),
  content?: string(name='Content', example='-'),
  createdTime?: long(name='CreatedTime', example='1646100927'),
  message?: string(name='Message', example='successful'),
  name?: string(name='Name', example='hdr.task.name.TestFailoverTask'),
  progress?: int32(name='Progress', example='100'),
  requestId?: string(name='RequestId', example='8F8A2274-F2A5-5782-89A0-7FA442BFA16B'),
  statusCode?: string(name='StatusCode', example='hdr.task.TestFailoverTask.waitStartFailover'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-000bzkmmlwh57miq4mwh'),
  updatedTime?: long(name='UpdatedTime', example='1636452195'),
}

model DescribeTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeTaskResponseBody(name='body'),
}

async function describeTaskWithOptions(request: DescribeTaskRequest, runtime: Util.RuntimeOptions): DescribeTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTask',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTask(request: DescribeTaskRequest): DescribeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTaskWithOptions(request, runtime);
}

model DescribeTasksRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  securityToken?: string(name='SecurityToken'),
  sitePairId?: string(name='SitePairId', example='s-000cm9ax8sh22u8r9gs0'),
  sortBy?: string(name='SortBy', example='createdTime'),
}

model DescribeTasksResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  pageNumber?: int32(name='PageNumber', example='3'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='86FFBA6E-D087-53E0-8593-4575925CB9DC'),
  success?: boolean(name='Success', example='True'),
  tasks?: {
    task?: [ 
    {
      createdTime?: long(name='CreatedTime', example='1636092147'),
      name?: string(name='Name', example='CommitFailoverTask'),
      progress?: int32(name='Progress', example='90'),
      statusCode?: string(name='StatusCode', example='hdr.task.completed'),
      targetName?: string(name='TargetName', example='sr-000ftuch27gfuv8wvpyj'),
      taskId?: string(name='TaskId', example='t-0007wl5r0hvxrp3c3x8z'),
      updatedTime?: long(name='UpdatedTime', example='1637292645'),
    }
  ](name='task')
  }(name='Tasks'),
  totalCount?: long(name='TotalCount', example='53'),
}

model DescribeTasksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeTasksResponseBody(name='body'),
}

async function describeTasksWithOptions(request: DescribeTasksRequest, runtime: Util.RuntimeOptions): DescribeTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTasks',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTasks(request: DescribeTasksRequest): DescribeTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTasksWithOptions(request, runtime);
}

model DisableReplicationRequest {
  serverId?: string(name='ServerId', example='sr-000cvyfewfi6fzi9zoql'),
}

model DisableReplicationResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='B7F69F73-51C4-5D3F-B2BE-E1BD99022C15'),
  success?: boolean(name='Success', example='True'),
}

model DisableReplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableReplicationResponseBody(name='body'),
}

async function disableReplicationWithOptions(request: DisableReplicationRequest, runtime: Util.RuntimeOptions): DisableReplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableReplication',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableReplication(request: DisableReplicationRequest): DisableReplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableReplicationWithOptions(request, runtime);
}

model EnableReplicationRequest {
  crashConsistentPointPolicy?: string(name='CrashConsistentPointPolicy', example='{"scheduleType":"CRON","expression":"0 0 */1 * * 0,1,2,3,4,5,6","initialDelay":0}'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-bp1g0s2u3b2kbn46kiy53'),
  replicationNetwork?: string(name='ReplicationNetwork', example='vsw-bp1g0s2u3b2kbn46kiy53'),
  replicationUseEssd?: boolean(name='ReplicationUseEssd', example='false'),
  replicationUseSsd?: boolean(name='ReplicationUseSsd', example='false'),
  serverId?: string(name='ServerId', example='sr-0005qxusucbo6yomzb9x'),
}

model EnableReplicationResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='E50FE4A6-C876-5D6F-8A09-93442308AA7B'),
  success?: boolean(name='Success', example='True'),
}

model EnableReplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableReplicationResponseBody(name='body'),
}

async function enableReplicationWithOptions(request: EnableReplicationRequest, runtime: Util.RuntimeOptions): EnableReplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crashConsistentPointPolicy)) {
    query['CrashConsistentPointPolicy'] = request.crashConsistentPointPolicy;
  }
  if (!Util.isUnset(request.recoveryNetwork)) {
    query['RecoveryNetwork'] = request.recoveryNetwork;
  }
  if (!Util.isUnset(request.replicationNetwork)) {
    query['ReplicationNetwork'] = request.replicationNetwork;
  }
  if (!Util.isUnset(request.replicationUseEssd)) {
    query['ReplicationUseEssd'] = request.replicationUseEssd;
  }
  if (!Util.isUnset(request.replicationUseSsd)) {
    query['ReplicationUseSsd'] = request.replicationUseSsd;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableReplication',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableReplication(request: EnableReplicationRequest): EnableReplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableReplicationWithOptions(request, runtime);
}

model FailbackRequest {
  recoveryCpu?: int32(name='RecoveryCpu', example='4'),
  recoveryInfrastructureId?: string(name='RecoveryInfrastructureId', example='is-0007rvzart0rz2byr2x0'),
  recoveryInstanceName?: string(name='RecoveryInstanceName', example='HDR_Recovery-sr-0007rvzart0rz2bv9fzm'),
  recoveryInstanceType?: string(name='RecoveryInstanceType', example='ecs.c5.2xlarge'),
  recoveryIpAddress?: string(name='RecoveryIpAddress', example='192.168.2.2'),
  recoveryMemory?: long(name='RecoveryMemory', example='4294967296'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-bp1xmea0mkjtxqoubk7q8'),
  recoveryPointId?: string(name='RecoveryPointId', example='rp-0001625ljmig7ahibe0y'),
  recoveryPostScriptContent?: string(name='RecoveryPostScriptContent', example='"echo \\"127.0.0.1 kubernetes.docker.internal\\" >> /etc/hosts"'),
  recoveryPostScriptType?: string(name='RecoveryPostScriptType', example='SHELL'),
  recoveryReserveIp?: boolean(name='RecoveryReserveIp', example='true'),
  recoveryUseDhcp?: boolean(name='RecoveryUseDhcp', example='false'),
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000bzkmmlwghj95tnx15'),
}

model FailbackResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='56CF7F68-C07B-5BE2-BE82-09D8E9719076'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-0004ka624vrza82g46ne'),
}

model FailbackResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FailbackResponseBody(name='body'),
}

async function failbackWithOptions(request: FailbackRequest, runtime: Util.RuntimeOptions): FailbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.recoveryCpu)) {
    query['RecoveryCpu'] = request.recoveryCpu;
  }
  if (!Util.isUnset(request.recoveryInfrastructureId)) {
    query['RecoveryInfrastructureId'] = request.recoveryInfrastructureId;
  }
  if (!Util.isUnset(request.recoveryInstanceName)) {
    query['RecoveryInstanceName'] = request.recoveryInstanceName;
  }
  if (!Util.isUnset(request.recoveryInstanceType)) {
    query['RecoveryInstanceType'] = request.recoveryInstanceType;
  }
  if (!Util.isUnset(request.recoveryIpAddress)) {
    query['RecoveryIpAddress'] = request.recoveryIpAddress;
  }
  if (!Util.isUnset(request.recoveryMemory)) {
    query['RecoveryMemory'] = request.recoveryMemory;
  }
  if (!Util.isUnset(request.recoveryNetwork)) {
    query['RecoveryNetwork'] = request.recoveryNetwork;
  }
  if (!Util.isUnset(request.recoveryPointId)) {
    query['RecoveryPointId'] = request.recoveryPointId;
  }
  if (!Util.isUnset(request.recoveryPostScriptContent)) {
    query['RecoveryPostScriptContent'] = request.recoveryPostScriptContent;
  }
  if (!Util.isUnset(request.recoveryPostScriptType)) {
    query['RecoveryPostScriptType'] = request.recoveryPostScriptType;
  }
  if (!Util.isUnset(request.recoveryReserveIp)) {
    query['RecoveryReserveIp'] = request.recoveryReserveIp;
  }
  if (!Util.isUnset(request.recoveryUseDhcp)) {
    query['RecoveryUseDhcp'] = request.recoveryUseDhcp;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Failback',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function failback(request: FailbackRequest): FailbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return failbackWithOptions(request, runtime);
}

model ForcedFailoverRequest {
  eipAddressId?: string(name='EipAddressId', example='eip-bp1x7nua6eab8m4vsis9k'),
  recoveryCpu?: int32(name='RecoveryCpu', example='4'),
  recoveryEssdPerformanceLevel?: string(name='RecoveryEssdPerformanceLevel', example='PL2'),
  recoveryInstanceName?: string(name='RecoveryInstanceName', example='HDR_Recovery-sr-000bzkmmlwghq3soqry2'),
  recoveryInstanceType?: string(name='RecoveryInstanceType', example='ecs.r5.3xlarge'),
  recoveryIpAddress?: string(name='RecoveryIpAddress', example='192.168.2.2'),
  recoveryMemory?: long(name='RecoveryMemory', example='4294967296'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-bp1fh05y7ybq9kep6rtwu'),
  recoveryPointId?: string(name='RecoveryPointId', example='rp-000184qxs690bth6jyqn'),
  recoveryPointTime?: long(name='RecoveryPointTime', example='1636526948'),
  recoveryPostScriptContent?: string(name='RecoveryPostScriptContent', example='echo \\"127.0.0.1 kubernetes.docker.internal\\" >> /etc/hosts'),
  recoveryPostScriptType?: string(name='RecoveryPostScriptType', example='SHELL'),
  recoveryReserveIp?: boolean(name='RecoveryReserveIp', example='false'),
  recoveryUseDhcp?: boolean(name='RecoveryUseDhcp', example='false'),
  recoveryUseEssd?: boolean(name='RecoveryUseEssd', example='false'),
  recoveryUseSsd?: boolean(name='RecoveryUseSsd', example='false'),
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000ih1rl47q6hksc910d'),
}

model ForcedFailoverResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='26DF0E81-08E2-5AE3-96AA-05F5F826261C'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-000ios55mggw4ifiy3nc'),
}

model ForcedFailoverResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ForcedFailoverResponseBody(name='body'),
}

async function forcedFailoverWithOptions(request: ForcedFailoverRequest, runtime: Util.RuntimeOptions): ForcedFailoverResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eipAddressId)) {
    query['EipAddressId'] = request.eipAddressId;
  }
  if (!Util.isUnset(request.recoveryCpu)) {
    query['RecoveryCpu'] = request.recoveryCpu;
  }
  if (!Util.isUnset(request.recoveryEssdPerformanceLevel)) {
    query['RecoveryEssdPerformanceLevel'] = request.recoveryEssdPerformanceLevel;
  }
  if (!Util.isUnset(request.recoveryInstanceName)) {
    query['RecoveryInstanceName'] = request.recoveryInstanceName;
  }
  if (!Util.isUnset(request.recoveryInstanceType)) {
    query['RecoveryInstanceType'] = request.recoveryInstanceType;
  }
  if (!Util.isUnset(request.recoveryIpAddress)) {
    query['RecoveryIpAddress'] = request.recoveryIpAddress;
  }
  if (!Util.isUnset(request.recoveryMemory)) {
    query['RecoveryMemory'] = request.recoveryMemory;
  }
  if (!Util.isUnset(request.recoveryNetwork)) {
    query['RecoveryNetwork'] = request.recoveryNetwork;
  }
  if (!Util.isUnset(request.recoveryPointId)) {
    query['RecoveryPointId'] = request.recoveryPointId;
  }
  if (!Util.isUnset(request.recoveryPointTime)) {
    query['RecoveryPointTime'] = request.recoveryPointTime;
  }
  if (!Util.isUnset(request.recoveryPostScriptContent)) {
    query['RecoveryPostScriptContent'] = request.recoveryPostScriptContent;
  }
  if (!Util.isUnset(request.recoveryPostScriptType)) {
    query['RecoveryPostScriptType'] = request.recoveryPostScriptType;
  }
  if (!Util.isUnset(request.recoveryReserveIp)) {
    query['RecoveryReserveIp'] = request.recoveryReserveIp;
  }
  if (!Util.isUnset(request.recoveryUseDhcp)) {
    query['RecoveryUseDhcp'] = request.recoveryUseDhcp;
  }
  if (!Util.isUnset(request.recoveryUseEssd)) {
    query['RecoveryUseEssd'] = request.recoveryUseEssd;
  }
  if (!Util.isUnset(request.recoveryUseSsd)) {
    query['RecoveryUseSsd'] = request.recoveryUseSsd;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ForcedFailover',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function forcedFailover(request: ForcedFailoverRequest): ForcedFailoverResponse {
  var runtime = new Util.RuntimeOptions{};
  return forcedFailoverWithOptions(request, runtime);
}

model RegisterServersRequest {
  agentPort?: int32(name='AgentPort', example='9080'),
  serverInstancesInfo?: string(name='ServerInstancesInfo', example='"[{\\"instanceId\\":\\"i-uf60ngpe9sseu5gsgu45\\",\\"privateIpAddress\\":\\"192.168.1.198\\",\\"osType\\":\\"linux\\",\\"osName\\":\\"CentOS  7.8 64位\\",\\"cpu\\":2,\\"memory\\":4294967296,\\"hostName\\":\\"hdr-test\\"}]"'),
  sitePairId?: string(name='SitePairId', example='s-000cm9ax8sgzwujrzdwt'),
}

model RegisterServersResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='D76E741C-68B7-5281-8C5B-698AD06B0D89'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-0001nlbcl4bynbb67x4w'),
}

model RegisterServersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RegisterServersResponseBody(name='body'),
}

async function registerServersWithOptions(request: RegisterServersRequest, runtime: Util.RuntimeOptions): RegisterServersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentPort)) {
    query['AgentPort'] = request.agentPort;
  }
  if (!Util.isUnset(request.serverInstancesInfo)) {
    query['ServerInstancesInfo'] = request.serverInstancesInfo;
  }
  if (!Util.isUnset(request.sitePairId)) {
    query['SitePairId'] = request.sitePairId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RegisterServers',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function registerServers(request: RegisterServersRequest): RegisterServersResponse {
  var runtime = new Util.RuntimeOptions{};
  return registerServersWithOptions(request, runtime);
}

model ReversedDisableReplicationRequest {
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000cm9ax8sh2i6pc16u9'),
}

model ReversedDisableReplicationResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='5904D638-152A-5F1F-8652-E535EABF3ABA'),
  success?: boolean(name='Success', example='True'),
}

model ReversedDisableReplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReversedDisableReplicationResponseBody(name='body'),
}

async function reversedDisableReplicationWithOptions(request: ReversedDisableReplicationRequest, runtime: Util.RuntimeOptions): ReversedDisableReplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReversedDisableReplication',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reversedDisableReplication(request: ReversedDisableReplicationRequest): ReversedDisableReplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return reversedDisableReplicationWithOptions(request, runtime);
}

model ReversedEnableReplicationRequest {
  appConsistentPointPolicy?: string(name='AppConsistentPointPolicy', description='-', example='-'),
  crashConsistentPointPolicy?: string(name='CrashConsistentPointPolicy', description='-', example='-'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-bp1xmea0mkjtxqoubk7q8'),
  replicationComputeResource?: string(name='ReplicationComputeResource', description='-', example='-'),
  replicationDatastore?: string(name='ReplicationDatastore', description='-', example='-'),
  replicationDns?: string(name='ReplicationDns', description='-', example='-'),
  replicationGateway?: string(name='ReplicationGateway', description='-', example='-'),
  replicationInfrastructureId?: string(name='ReplicationInfrastructureId', example='is-000bzkmmlwgibbduuoff'),
  replicationIpAddress?: string(name='ReplicationIpAddress', description='-', example='-'),
  replicationLocation?: string(name='ReplicationLocation', description='-', example='-'),
  replicationNetMask?: string(name='ReplicationNetMask', description='-', example='-'),
  replicationNetwork?: string(name='ReplicationNetwork', example='vsw-bp1ii4x07tey6sisg4blp'),
  replicationUseDhcp?: boolean(name='ReplicationUseDhcp', description='-', example='-'),
  replicationUseOriginalInstance?: boolean(name='ReplicationUseOriginalInstance', example='false'),
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000cm9ax8sh2381wa7kv'),
  shadowInstanceType?: string(name='ShadowInstanceType', description='-', example='-'),
}

model ReversedEnableReplicationResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='D5CF3A51-1F39-5B16-AC0C-AD9B632D100D'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-0004ka624vrxwublmqw6'),
}

model ReversedEnableReplicationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReversedEnableReplicationResponseBody(name='body'),
}

async function reversedEnableReplicationWithOptions(request: ReversedEnableReplicationRequest, runtime: Util.RuntimeOptions): ReversedEnableReplicationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appConsistentPointPolicy)) {
    query['AppConsistentPointPolicy'] = request.appConsistentPointPolicy;
  }
  if (!Util.isUnset(request.crashConsistentPointPolicy)) {
    query['CrashConsistentPointPolicy'] = request.crashConsistentPointPolicy;
  }
  if (!Util.isUnset(request.recoveryNetwork)) {
    query['RecoveryNetwork'] = request.recoveryNetwork;
  }
  if (!Util.isUnset(request.replicationComputeResource)) {
    query['ReplicationComputeResource'] = request.replicationComputeResource;
  }
  if (!Util.isUnset(request.replicationDatastore)) {
    query['ReplicationDatastore'] = request.replicationDatastore;
  }
  if (!Util.isUnset(request.replicationDns)) {
    query['ReplicationDns'] = request.replicationDns;
  }
  if (!Util.isUnset(request.replicationGateway)) {
    query['ReplicationGateway'] = request.replicationGateway;
  }
  if (!Util.isUnset(request.replicationInfrastructureId)) {
    query['ReplicationInfrastructureId'] = request.replicationInfrastructureId;
  }
  if (!Util.isUnset(request.replicationIpAddress)) {
    query['ReplicationIpAddress'] = request.replicationIpAddress;
  }
  if (!Util.isUnset(request.replicationLocation)) {
    query['ReplicationLocation'] = request.replicationLocation;
  }
  if (!Util.isUnset(request.replicationNetMask)) {
    query['ReplicationNetMask'] = request.replicationNetMask;
  }
  if (!Util.isUnset(request.replicationNetwork)) {
    query['ReplicationNetwork'] = request.replicationNetwork;
  }
  if (!Util.isUnset(request.replicationUseDhcp)) {
    query['ReplicationUseDhcp'] = request.replicationUseDhcp;
  }
  if (!Util.isUnset(request.replicationUseOriginalInstance)) {
    query['ReplicationUseOriginalInstance'] = request.replicationUseOriginalInstance;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  if (!Util.isUnset(request.shadowInstanceType)) {
    query['ShadowInstanceType'] = request.shadowInstanceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReversedEnableReplication',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reversedEnableReplication(request: ReversedEnableReplicationRequest): ReversedEnableReplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  return reversedEnableReplicationWithOptions(request, runtime);
}

model TestCleanupRequest {
  serverId?: string(name='ServerId', example='sr-000cvyfewfi6fzi9zoql'),
}

model TestCleanupResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='531E3DB9-3ED6-5F06-A09A-721F279CB64B'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-000bzkmmlwh6tpzhitdz'),
}

model TestCleanupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TestCleanupResponseBody(name='body'),
}

async function testCleanupWithOptions(request: TestCleanupRequest, runtime: Util.RuntimeOptions): TestCleanupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TestCleanup',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function testCleanup(request: TestCleanupRequest): TestCleanupResponse {
  var runtime = new Util.RuntimeOptions{};
  return testCleanupWithOptions(request, runtime);
}

model TestFailoverRequest {
  eipAddressId?: string(name='EipAddressId', example='eip-bp1nf283u9p060q4gim7m'),
  recoveryCpu?: int32(name='RecoveryCpu', example='2'),
  recoveryEssdPerformanceLevel?: string(name='RecoveryEssdPerformanceLevel', example='PL3'),
  recoveryInstanceName?: string(name='RecoveryInstanceName', example='test-failover-instance'),
  recoveryInstanceType?: string(name='RecoveryInstanceType', example='ecs.c5.large'),
  recoveryIpAddress?: string(name='RecoveryIpAddress', example='10.10.10.10'),
  recoveryMemory?: long(name='RecoveryMemory', example='4294967296'),
  recoveryNetwork?: string(name='RecoveryNetwork', example='vsw-bp1g0s2u3b2kbn46kiy53'),
  recoveryPointId?: string(name='RecoveryPointId', example='rp-0001cgurtbrvrkj2p2pp'),
  recoveryPointTime?: long(name='RecoveryPointTime', example='1646046000'),
  recoveryPostScriptContent?: string(name='RecoveryPostScriptContent', example='echo \\"127.0.0.1 kubernetes.docker.internal\\" >> /etc/hosts'),
  recoveryPostScriptType?: string(name='RecoveryPostScriptType', example='SHELL'),
  recoveryReserveIp?: boolean(name='RecoveryReserveIp', example='false'),
  recoveryUseDhcp?: boolean(name='RecoveryUseDhcp', example='false'),
  recoveryUseEssd?: boolean(name='RecoveryUseEssd', example='false'),
  recoveryUseSsd?: boolean(name='RecoveryUseSsd', example='false'),
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000cvyfewfi7eudxml1a'),
}

model TestFailoverResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='6758891B-CF5A-5CA6-BF59-633573B91140'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-000h3k00ckeknbukn5a5'),
}

model TestFailoverResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TestFailoverResponseBody(name='body'),
}

async function testFailoverWithOptions(request: TestFailoverRequest, runtime: Util.RuntimeOptions): TestFailoverResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eipAddressId)) {
    query['EipAddressId'] = request.eipAddressId;
  }
  if (!Util.isUnset(request.recoveryCpu)) {
    query['RecoveryCpu'] = request.recoveryCpu;
  }
  if (!Util.isUnset(request.recoveryEssdPerformanceLevel)) {
    query['RecoveryEssdPerformanceLevel'] = request.recoveryEssdPerformanceLevel;
  }
  if (!Util.isUnset(request.recoveryInstanceName)) {
    query['RecoveryInstanceName'] = request.recoveryInstanceName;
  }
  if (!Util.isUnset(request.recoveryInstanceType)) {
    query['RecoveryInstanceType'] = request.recoveryInstanceType;
  }
  if (!Util.isUnset(request.recoveryIpAddress)) {
    query['RecoveryIpAddress'] = request.recoveryIpAddress;
  }
  if (!Util.isUnset(request.recoveryMemory)) {
    query['RecoveryMemory'] = request.recoveryMemory;
  }
  if (!Util.isUnset(request.recoveryNetwork)) {
    query['RecoveryNetwork'] = request.recoveryNetwork;
  }
  if (!Util.isUnset(request.recoveryPointId)) {
    query['RecoveryPointId'] = request.recoveryPointId;
  }
  if (!Util.isUnset(request.recoveryPointTime)) {
    query['RecoveryPointTime'] = request.recoveryPointTime;
  }
  if (!Util.isUnset(request.recoveryPostScriptContent)) {
    query['RecoveryPostScriptContent'] = request.recoveryPostScriptContent;
  }
  if (!Util.isUnset(request.recoveryPostScriptType)) {
    query['RecoveryPostScriptType'] = request.recoveryPostScriptType;
  }
  if (!Util.isUnset(request.recoveryReserveIp)) {
    query['RecoveryReserveIp'] = request.recoveryReserveIp;
  }
  if (!Util.isUnset(request.recoveryUseDhcp)) {
    query['RecoveryUseDhcp'] = request.recoveryUseDhcp;
  }
  if (!Util.isUnset(request.recoveryUseEssd)) {
    query['RecoveryUseEssd'] = request.recoveryUseEssd;
  }
  if (!Util.isUnset(request.recoveryUseSsd)) {
    query['RecoveryUseSsd'] = request.recoveryUseSsd;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TestFailover',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function testFailover(request: TestFailoverRequest): TestFailoverResponse {
  var runtime = new Util.RuntimeOptions{};
  return testFailoverWithOptions(request, runtime);
}

model TriggerReversedRegisterRequest {
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-0007rvzart0bneyhl4q1'),
}

model TriggerReversedRegisterResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='1D39F0BE-B3F9-5AA9-AD49-BE8CD7B4BF7B'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-000fzufp79idzl6bniso'),
}

model TriggerReversedRegisterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TriggerReversedRegisterResponseBody(name='body'),
}

async function triggerReversedRegisterWithOptions(request: TriggerReversedRegisterRequest, runtime: Util.RuntimeOptions): TriggerReversedRegisterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TriggerReversedRegister',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function triggerReversedRegister(request: TriggerReversedRegisterRequest): TriggerReversedRegisterResponse {
  var runtime = new Util.RuntimeOptions{};
  return triggerReversedRegisterWithOptions(request, runtime);
}

model UnregisterServerRequest {
  securityToken?: string(name='SecurityToken'),
  serverId?: string(name='ServerId', example='sr-000jf20efavec47ucq5g'),
}

model UnregisterServerResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='D2E81EC9-B206-54EA-BBCF-9D4D6AFE7AA8'),
  success?: boolean(name='Success', example='True'),
}

model UnregisterServerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnregisterServerResponseBody(name='body'),
}

async function unregisterServerWithOptions(request: UnregisterServerRequest, runtime: Util.RuntimeOptions): UnregisterServerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.serverId)) {
    query['ServerId'] = request.serverId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnregisterServer',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unregisterServer(request: UnregisterServerRequest): UnregisterServerResponse {
  var runtime = new Util.RuntimeOptions{};
  return unregisterServerWithOptions(request, runtime);
}

model UpdateRecoveryPlanRequest {
  content?: string(name='Content', example='{
    "groups": [
        {
            "name": "Group-1",
            "id": "Group-1",
            "servers": [
                {
                    "name": "sr-xxxxxxxxxxxxxxxxxx",
                    "serverId": "sr-xxxxxxxxxxxxxxxxxx",
                    "testFailoverAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-tfo",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    },
                    "testCleanupAction": {},
                    "changeRecoveryPointAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-cpr",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    },
                    "forcedFailoverAction": {
                        "eipAddressId": "",
                        "recoveryPostScriptContent": "",
                        "recoveryPostScriptType": "POWERSHELL",
                        "recoveryInstanceName": "HDR_Recovery-sr-xxxxxxxxxxxxxxxxxx-ffo",
                        "recoveryCpu": 2,
                        "recoveryMemory": 4294967296,
                        "recoveryUseEssd": false,
                        "recoveryUseSsd": false,
                        "recoveryReserveIp": false,
                        "recoveryUseDhcp": true,
                        "recoveryIpAddress": "",
                        "recoveryNetwork": "vsw-xxxxxxxxxxxxxxxxxx"
                    }
                }
            ]
        }
    ]
}'),
  name?: string(name='Name', example='test-1'),
  recoveryPlanId?: string(name='RecoveryPlanId', example='rp-xxxxxxxxxxxxxxxx'),
}

model UpdateRecoveryPlanResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='F1B86896-AB3E-5861-9E33-10486F056BB3'),
  success?: boolean(name='Success', example='True'),
  taskId?: string(name='TaskId', example='t-000ir69ra7neqp2p4qdv'),
}

model UpdateRecoveryPlanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateRecoveryPlanResponseBody(name='body'),
}

async function updateRecoveryPlanWithOptions(request: UpdateRecoveryPlanRequest, runtime: Util.RuntimeOptions): UpdateRecoveryPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.recoveryPlanId)) {
    query['RecoveryPlanId'] = request.recoveryPlanId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRecoveryPlan',
    version = '2017-09-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateRecoveryPlan(request: UpdateRecoveryPlanRequest): UpdateRecoveryPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRecoveryPlanWithOptions(request, runtime);
}

